package com.consumer.consul.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author：Administrator
 * @Date：2022/7/9/0009 9:37
 * @Versiion：1.0
 */
@Configuration
public class RestTemplateConfig {

    @Bean
    @LoadBalanced
    /**
     * LoadBalanced 源码中会将注册中心的服务名替换成ip:port
     */
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
